.class Lcom/baidu/bm;
.super Landroid/telephony/PhoneStateListener;


# instance fields
.field private a:Lcom/baidu/l;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Landroid/telephony/PhoneStateListener;-><init>()V

    return-void
.end method

.method private a()Lcom/baidu/l;
    .locals 1

    iget-object v0, p0, Lcom/baidu/bm;->a:Lcom/baidu/l;

    return-object v0
.end method


# virtual methods
.method public a(Lcom/baidu/l;)V
    .locals 0

    iput-object p1, p0, Lcom/baidu/bm;->a:Lcom/baidu/l;

    return-void
.end method

.method public onCallStateChanged(ILjava/lang/String;)V
    .locals 4

    invoke-super {p0, p1, p2}, Landroid/telephony/PhoneStateListener;->onCallStateChanged(ILjava/lang/String;)V

    packed-switch p1, :pswitch_data_0

    :cond_0
    :goto_0
    return-void

    :pswitch_0
    :try_start_0
    const-string v0, "CALL_STATE_IDLE"

    invoke-static {v0}, Lcom/baidu/bk;->b(Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    const-string v1, "onCallStateChanged"

    invoke-static {v1, v0}, Lcom/baidu/bk;->a(Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0

    :pswitch_1
    :try_start_1
    const-string v0, "CALL_STATE_OFFHOOK in:%s"

    const/4 v1, 0x1

    new-array v1, v1, [Ljava/lang/Object;

    const/4 v2, 0x0

    aput-object p2, v1, v2

    invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/baidu/bk;->b(Ljava/lang/String;)I

    invoke-direct {p0}, Lcom/baidu/bm;->a()Lcom/baidu/l;

    move-result-object v0

    if-eqz v0, :cond_0

    if-eqz p2, :cond_1

    const-string v0, ""

    invoke-virtual {p2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    :cond_1
    const-string v0, "CALL_STATE_OFFHOOK in:%s adcon:%s"

    const/4 v1, 0x2

    new-array v1, v1, [Ljava/lang/Object;

    const/4 v2, 0x0

    aput-object p2, v1, v2

    const/4 v2, 0x1

    invoke-direct {p0}, Lcom/baidu/bm;->a()Lcom/baidu/l;

    move-result-object v3

    invoke-virtual {v3}, Lcom/baidu/l;->h()Lcom/baidu/Ad;

    move-result-object v3

    invoke-virtual {v3}, Lcom/baidu/Ad;->getPhone()Ljava/lang/String;

    move-result-object v3

    aput-object v3, v1, v2

    invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/baidu/bk;->b(Ljava/lang/String;)I

    invoke-direct {p0}, Lcom/baidu/bm;->a()Lcom/baidu/l;

    move-result-object v0

    invoke-virtual {v0}, Lcom/baidu/l;->e()V

    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/baidu/bm;->a(Lcom/baidu/l;)V

    goto :goto_0

    :pswitch_2
    const-string v0, "CALL_STATE_RINGING"

    invoke-static {v0}, Lcom/baidu/bk;->b(Ljava/lang/String;)I
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_2
        :pswitch_1
    .end packed-switch
.end method
